<?php
// +----------------------------------------------------------------------
// | author: admin
// +----------------------------------------------------------------------

namespace app\adminapi\validate\order;


use app\common\validate\BaseValidate;


/**
 * Order验证器
 * Class OrderValidate
 * @package app\adminapi\validate\order
 */
class OrderValidate extends BaseValidate
{

     /**
      * 设置校验规则
      * @var string[]
      */
    protected $rule = [
        'id' => 'require',
        'order_no' => 'require',
        'order_type' => 'require',
        'user_id' => 'require',
        'people_num' => 'require',
        'baggage_num' => 'require',
        'line_id' => 'require',
        'driver_id' => 'require',
        'car_num' => 'require',
        'estimated_time' => 'require',
        'start_address' => 'require',
        'end_address' => 'require',
        'people_name' => 'require',
        'people_phone' => 'require',
        'verify_code' => 'require',
    ];


    /**
     * 参数描述
     * @var string[]
     */
    protected $field = [
        'id' => 'id',
        'order_no' => '订单号',
        'order_type' => '订单类型: [1-包车订单 2-接送机订单]',
        'user_id' => '用户ID',
        'people_num' => '人数',
        'baggage_num' => '行李数',
        'line_id' => '线路ID',
        'driver_id' => '司机ID',
        'car_num' => '车牌号',
        'estimated_time' => '预计出发时间',
        'start_address' => '出发地点',
        'end_address' => '目的地点',
        'people_name' => '出行人姓名',
        'people_phone' => '出行人电话',
        'verify_code' => '核验码',
    ];


    /**
     * @notes 添加场景
     * @return OrderValidate
     * @author admin
     * @date 2025/04/29 17:52
     */
    public function sceneAdd()
    {
        return $this->only(['order_no','order_type','user_id','people_num','baggage_num','line_id','driver_id','car_num','estimated_time','start_address','end_address','people_name','people_phone','verify_code']);
    }


    /**
     * @notes 编辑场景
     * @return OrderValidate
     * @author admin
     * @date 2025/04/29 17:52
     */
    public function sceneEdit()
    {
        return $this->only(['id','order_no','order_type','user_id','people_num','baggage_num','line_id','driver_id','car_num','estimated_time','start_address','end_address','people_name','people_phone','verify_code']);
    }


    /**
     * @notes 删除场景
     * @return OrderValidate
     * @author admin
     * @date 2025/04/29 17:52
     */
    public function sceneDelete()
    {
        return $this->only(['id']);
    }


    /**
     * @notes 详情场景
     * @return OrderValidate
     * @author admin
     * @date 2025/04/29 17:52
     */
    public function sceneDetail()
    {
        return $this->only(['id']);
    }

}